import random

'Mozilla/5.0 (Windows NT 6.1; rv:68.7) Gecko/20100101 Firefox/68.7'
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'
def get_ua():
    first_num = random.randint(55, 81)
    third_num = random.randint(0, 3538)
    fourth_num = random.randint(0, 140)
    os_type = [
        '(Windows NT 6.1; WOW64)', '(Windows NT 10.0; WOW64)', '(X11; Linux x86_64)',
        '(Macintosh; Intel Mac OS X 10_12_6)'
    ]
    chrome_version = 'Chrome/{}.0.{}.{}'.format(first_num, third_num, fourth_num)

    ua = 'Mozilla/5.0'+random.choice(os_type)+'AppleWebKit/537.36 (KHTML, like Gecko)'+chrome_version+'Safari/537.36'
    return ua


ua = get_ua()
print(ua)
